from celery import Celery

# broker：任务仓库
broker = 'redis://127.0.0.1:6379/5'
# backend：任务结果仓库
backend = 'redis://127.0.0.1:6379/6'
# include：任务(函数)所在文件
app = Celery(broker=broker, backend=backend, include=['celery_task.tasks'])

# 启动服务的命令
# 非windows
# >: cd 到celery_task所在文件夹下
# >: celery worker -A celery_task -l info

# windows：
# >: pip3 install eventlet
# >: cd 到celery_task所在文件夹下
# >: celery worker -A celery_task -l info -P eventlet

